package cn.flying.cloud.esb.model;

import javax.validation.Valid;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 接口请求对象
 *
 * @author: admin
 * @date: 2025年01月16日 15:17
 * @version: 1.0
 */
public class ApiRequest<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 请求头
     */
    @Valid // 启用嵌套对象校验
    @JsonProperty(value = "header")
    private ApiHeader header;

    /**
     * 请求体
     */
    @JsonProperty(value = "body")
    private T body;
    /**
     * 报文签名
     */
    @JsonProperty(value = "signature")
    private String signature;

    public ApiHeader getHeader() {
        return header;
    }

    public void setHeader(ApiHeader header) {
        this.header = header;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }
}